home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 7 / Amiga Format AFCD07 (Dec 1996, Issue 91).iso / serious / shareware / programming / aros / exec / addresource.c < prev    next >
C/C++ Source or Header  |  1996-09-12  |  1KB  |  71 lines

  1. /*
  2.     (C) 1995-96 AROS - The Amiga Replacement OS
  3.     $Id: addresource.c,v 1.4 1996/08/13 13:55:56 digulla Exp $
  4.     $Log: addresource.c,v $
  5.     Revision 1.4  1996/08/13 13:55:56  digulla
  6.     Replaced __AROS_LA by __AROS_LHA
  7.     Replaced some __AROS_LH*I by __AROS_LH*
  8.     Sorted and added includes
  9.  
  10.     Revision 1.3  1996/08/01 17:41:02  digulla
  11.     Added standard header for all files
  12.  
  13.     Desc:
  14.     Lang: english
  15. */
  16. #include <exec/execbase.h>
  17. #include <aros/libcall.h>
  18.  
  19. /*****************************************************************************
  20.  
  21.     NAME */
  22.     #include <clib/exec_protos.h>
  23.  
  24.     __AROS_LH1(void, AddResource,
  25.  
  26. /*  SYNOPSIS */
  27.     __AROS_LHA(APTR, resource, A1),
  28.  
  29. /*  LOCATION */
  30.     struct ExecBase *, SysBase, 81, Exec)
  31.  
  32. /*  FUNCTION
  33.     Adds a given resource to the system's resource list.
  34.  
  35.     INPUTS
  36.     resource - Pointer to a ready for use resource.
  37.  
  38.     RESULT
  39.  
  40.     NOTES
  41.  
  42.     EXAMPLE
  43.  
  44.     BUGS
  45.  
  46.     SEE ALSO
  47.     RemResource(), OpenResource()
  48.  
  49.     INTERNALS
  50.  
  51.     HISTORY
  52.  
  53. ******************************************************************************/
  54. {
  55.     __AROS_FUNC_INIT
  56.  
  57.     /* Just in case the user forgot them */
  58.     ((struct Node *)resource)->ln_Type=NT_RESOURCE;
  59.  
  60.     /* Arbitrate for the resource list */
  61.     Forbid();
  62.  
  63.     /* And add the resource */
  64.     Enqueue(&SysBase->ResourceList,(struct Node *)resource);
  65.  
  66.     /* All done. */
  67.     Permit();
  68.     __AROS_FUNC_EXIT
  69. } /* AddResource */
  70.  
  71.